<?php 
namespace Home\Model;
use Think\Model;
class ErshouModel extends Model{
	protected $trueTableName='ershou';
	public function ershou_save($kind,$desc,$price,$area,$detail,$contract,$url,$user){
      if(empty($kind)||empty($desc)||empty($price)||empty($area)||empty($detail)||empty($contract)||empty($url)||empty($user)){
      	return 0;
      }else{
             $data['kind']=$kind;
             $data['desc']=$desc;
             $data['price']=$price;
             $data['area']=$area;
             $data['detail']=$detail;
             $data['contract']=$contract;
             $data['url']=$url;
             $data['user']=$user;
             $data['createtime']=time();

            $res=$this->add($data);
            //如果是自增主键则返回主键，否则返回1,如果插入失败返回false
            if($res){
               return 1;
            }else{
               return 0;
            }

      }
	}
      
}

 ?>